#light

open Langexplr.Abc
open Langexplr.Abc.InstructionUtilities
open System.IO


let abcFile = using (new FileStream("test.abc",FileMode.Open)) ( 
                    fun stream -> AvmAbcFile.Create(stream))

printf "loaded!"

let abcFileCreator = AbcFileCreator()
let file = abcFile.ToLowerIr(abcFileCreator)

let foo(f) =
   printf "%s" (f.ToString()) 
foo(file)

using (new BinaryWriter(new FileStream("test_t.abc",FileMode.Create))) 
      (fun f -> file.WriteTo(f))


let abcFile2 = using (new FileStream("test_t.abc",FileMode.Open)) ( 
                    fun stream -> AvmAbcFile.Create(stream))

printf "loaded2!"
